import Taro, { Component } from '@tarojs/taro'
import Index from './pages/index'

import './app.scss'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {

  config = {
    pages: [
      'pages/index/index',
      'pages/video/index',
      'pages/my/index',
      'pages/friend/index',
      'pages/account/index',
      'pages/search/index',
      'pages/login/phone',
      'pages/login/password',
      'pages/login/reset',
      'pages/playlist/index',
      'pages/now-playing/index',
      'pages/diary/index',
      'pages/relation-video/index',
    ],
    window: {
      navigationBarBackgroundColor: '#DC4238',
      navigationBarTitleText: '云音乐',
      navigationBarTextStyle: 'white',
      backgroundColor: '#C62F2F',
      backgroundTextStyle: 'light',
      enablePullDownRefresh: true,
      pageOrientation: 'auto'
    },
    tabBar: {
      custom: false,
      color: '#8D8D8D',
      selectedColor: '#C62F2F',
      list: [
        {
          pagePath: 'pages/index/index',
          iconPath: 'assets/images/discover.png',
          selectedIconPath: 'assets/images/selected-discover.png',
          text: '发现'
        },
        {
          pagePath: 'pages/video/index',
          iconPath: 'assets/images/video.png',
          selectedIconPath: 'assets/images/selected-video.png',
          text: '视频'
        },
        {
          pagePath: 'pages/my/index',
          iconPath: 'assets/images/music.png',
          selectedIconPath: 'assets/images/selected-music.png',
          text: '我的'
        },
        {
          pagePath: 'pages/friend/index',
          iconPath: 'assets/images/friend.png',
          selectedIconPath: 'assets/images/selected-friend.png',
          text: '朋友'
        },
        {
          pagePath: 'pages/account/index',
          iconPath: 'assets/images/account.png',
          selectedIconPath: 'assets/images/selected-account.png',
          text: '账号'
        }
      ]
    }
  }

  componentDidMount () {}

  componentDidShow () {}

  componentDidHide () {}

  componentDidCatchError () {}

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render () {
    return (
      <Index />
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
